package com.kxf.androidtestdemo.activity;

import android.os.Bundle;

import com.bumptech.glide.Glide;
import com.kxf.androidtestdemo.R;
import com.kxf.androidtestdemo.view.MyJzvdStd;

public class PlayVideoActivity extends BaseActivity {

    private MyJzvdStd jzvdStd;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_play_video);

        init();
    }

    private void init() {
        jzvdStd = findViewById(R.id.jz_video);
        jzvdStd.setUp("https://www.ikxf.top/pubFiles/video/sample_2.mp4"
                , "况况");
        Glide.with(this).load("https://www.ikxf.top/pubFiles/img/jw.jpg").into(jzvdStd.posterImageView);
    }

    @Override
    public void onBackPressed() {
        if (jzvdStd.backPress()) {
            return;
        }
        super.onBackPressed();
    }
    @Override
    protected void onPause() {
        super.onPause();
        jzvdStd.releaseAllVideos();
    }
}